function isName(){
	
	var name=document.getElementById("name").value;
	var error=document.getElementById("mark1");
	if(name==""){
		error.innerText="姓名不能为空!";
	
	}
	else{
		document.getElementById("name").style.border="1px solid #669933";
		return true;	
		
	}
	document.getElementById("name").style.border="1px solid red";
	return false;
}

function isPwd1(){
	var pwd1=document.getElementById("pwd1").value;
	var error=document.getElementById("mark2");
	var reg=/^[A-Za-z0-9_-]+$/;
	if(pwd1=="")
		error.innerText="密码不能为空!";
	else
	{
		if(reg.test(pwd1))
		{
			document.getElementById("pwd1").style.border="1px solid #669933";
			error.innerText="";
			return true;
		}
		else
			error.innerText="密码格式不正确!";
	}
	document.getElementById("pwd1").style.border="1px solid red";
	return false;
}

function isPwd2(){
	var pwd2=document.getElementById("pwd2").value;
	var pwd1=document.getElementById("pwd1").value;
	var error=document.getElementById("mark3");
	if(pwd2=="")
		error.innerText="不能为空!";
	else
	{
		if(pwd2==pwd1)
		{
			document.getElementById("pwd2").style.border="1px solid #669933";
			error.innerText="";
			return true;
		}
		else
			error.innerText="密码不一致!";
	}
	document.getElementById("pwd2").style.border="1px solid red";
	return false;
}

function isReg()
{
	if(isName()&&isPwd1()&&isPwd2())
		document.getElementById("regForm").submit();
	else
		alert("请完成注册单!");
}
